local que_xingjiang = fk.CreateSkill {
    name = "que_xingjiang",
    anim_type = "offensive",

}
Fk:loadTranslationTable {
    ["que_xingjiang"] = "星降",
    [":que_xingjiang"] = "出牌阶段限一次，你可以将一张手牌交给一名其他角色，持有此牌的角色本回合技能失效，然后你选择是否令其交给你一张由你指定类型的其他牌，若其不交，其失去一点体力。",

    ["@@que_xingjiang-turn"] = "星",
    ["#que_xingjiang_chos"] = "星降：请选择交给 %src 一张 %arg，否则失去一点体力",
}
que_xingjiang:addEffect("active", {
    anim_type = "control",
    prompt = "星降：你可以给别人一张牌，让他给你一张牌，不给就掉血。",
    card_num = 1,
    target_num = 1,
    can_use = function(self, player)
        return player:usedSkillTimes(que_xingjiang.name, Player.HistoryPhase) == 0
    end,
    card_filter = function(self, player, to_select, selected)
        return #selected == 0 and table.contains(player:getCardIds("h"), to_select)
    end,
    target_filter = function(self, player, to_select, selected)
        return #selected == 0 and to_select ~= player
    end,
    on_use = function(self, room, effect)
        local player = effect.from
        local target = effect.tos[1]
        room:moveCardTo(effect.cards, Card.PlayerHand, target, fk.ReasonGive, que_xingjiang.name, nil, false, player,
            "@@que_xingjiang-turn")
        local chs = room:askToChoice(player,
            { choices = { "basic", "trick", "equip", "Cancel" }, skill_name = que_xingjiang.name })
        if chs ~= "Cancel" then
            room:setPlayerMark(player, "que_xingjiang_type", chs)
            local ids = {}
            for _, id in ipairs(target:getCardIds("he")) do
                if Fk:getCardById(id):getMark("@@que_xingjiang-turn") == 0 and Fk:getCardById(id):getTypeString() == player:getMark("que_xingjiang_type") then
                    table.insert(ids, id)
                end
            end
            local card = room:askToCards(target, {
                min_num = 1,
                max_num = 1,
                include_equip = true,
                pattern = tostring(Exppattern { id = ids }),
                prompt = "#que_xingjiang_chos:" .. player.id .. "::" .. player:getMark("que_xingjiang_type"),
                skill_name = que_xingjiang.name,
                cancelable = true,
            })
            if #card > 0 then
                room:obtainCard(player, card, false, fk.ReasonGive, player)
            else
                room:loseHp(target, 1, que_xingjiang.name)
            end
        end
    end,
})
que_xingjiang:addEffect("invalidity", {
    invalidity_func = function(self, from, skill)
        return #table.filter(from:getCardIds("hej"),
                function(i) return Fk:getCardById(i):getMark("@@que_xingjiang-turn") > 0 end) > 0 and
            skill:isPlayerSkill(from)
    end,
})
return que_xingjiang
